(function(){window["UC"]=!!window["UC"]?window["UC"]:{};if(!!window["UC"]["Informer"])return;window.SPC=function(){this.stack=[];this.stackTimeout=null;this.stackPopup={};this.stackPopupTimeout={};this.stackPopupTimeout2={};this.stackPopupId=0;this.stackOverflow=false;this.notifyShow=0;this.notifyHideTime=5e3;this.notifyHeightCurrent=10;this.notifyHeightMax=0;this.notifyGarbageTimeout=null;this.notifyAutoHide=true;this.notifyAutoHideTimeout=null};var t=window.SPC;t.prototype.add=function(t){if(typeof t!="object"||!t.html)return false;if(BX.type.isDomNode(t.html))t.html=t.html.outerHTML;this.stack.push(t);if(!this.stackOverflow)this.setShowTimer(300);return true};t.prototype.remove=function(t){delete this.stack[t]};t.prototype.show=function(){this.notifyHeightMax=document.body.offsetHeight;var t=BX.GetWindowInnerSize();for(var e=0;e<this.stack.length;e++){if(typeof this.stack[e]=="undefined")continue;var i=new BX.PopupWindow("bx-sbpc-notify-flash-"+this.stackPopupId,{top:0,left:0},{lightShadow:true,zIndex:200,events:{onPopupClose:BX.delegate(function(){BX.proxy_context.popupContainer.style.opacity=0;this.notifyShow--;this.notifyHeightCurrent-=BX.proxy_context.popupContainer.offsetHeight+10;this.stackOverflow=false;setTimeout(BX.delegate(function(){this.destroy()},BX.proxy_context),1500)},this),onPopupDestroy:BX.delegate(function(){BX.unbindAll(BX.findChild(BX.proxy_context.popupContainer,{className:"bx-spbc-notifier-item-delete"},true));BX.unbindAll(BX.proxy_context.popupContainer);delete this.stackPopup[BX.proxy_context.uniquePopupId];delete this.stackPopupTimeout[BX.proxy_context.uniquePopupId];delete this.stackPopupTimeout2[BX.proxy_context.uniquePopupId]},this)},bindOnResize:false,content:BX.create("div",{props:{className:"bx-notifyManager-item-sbpc"},html:this.stack[e].html})});i.notifyParams=this.stack[e];i.notifyParams.id=e;i.show();BX.removeClass(i.popupContainer.firstChild,"popup-window");i.popupContainer.style.left=10+"px";i.popupContainer.style.opacity=0;if(this.notifyHeightMax<this.notifyHeightCurrent+i.popupContainer.offsetHeight+10){if(this.notifyShow>0){i.destroy();this.stackOverflow=true;break}}BX.addClass(i.popupContainer,"bx-notifyManager-animation-spbc");new BX.easing({duration:500,start:{opacity:0},finish:{opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){if(BX(i)&&BX(i.popupContainer))i.popupContainer.style.opacity=t.opacity/100}}).animate();i.popupContainer.style.top=t.innerHeight-this.notifyHeightCurrent-i.popupContainer.offsetHeight-10+"px";this.notifyHeightCurrent=this.notifyHeightCurrent+i.popupContainer.offsetHeight+10;this.stackPopupId++;this.notifyShow++;this.remove(e);this.stackPopupTimeout[i.uniquePopupId]=null;BX.bind(i.popupContainer,"mouseover",BX.delegate(function(){this.clearAutoHide()},this));BX.bind(i.popupContainer,"mouseout",BX.delegate(function(){this.setAutoHide(this.notifyHideTime/2)},this));BX.bind(i.popupContainer,"contextmenu",BX.delegate(function(t){if(this.stackPopup[BX.proxy_context.id].notifyParams.tag)this.closeByTag(this.stackPopup[BX.proxy_context.id].notifyParams.tag);else this.stackPopup[BX.proxy_context.id].close();return BX.PreventDefault(t)},this));var o=BX.findChildren(i.popupContainer,{tagName:"a"},true);for(var s=0;s<o.length;s++){if(o[s].href!="#")o[s].target="_blank"}BX.bind(BX.findChild(i.popupContainer,{className:"bx-spbc-notifier-item-delete"},true),"click",BX.delegate(function(t){var e=BX.proxy_context.parentNode.parentNode.parentNode.parentNode.id.replace("popup-window-content-","");if(this.stackPopup[e].notifyParams.close)this.stackPopup[e].notifyParams.close(this.stackPopup[e]);this.stackPopup[e].close();if(this.notifyAutoHide===false){this.clearAutoHide();this.setAutoHide(this.notifyHideTime/2)}return BX.PreventDefault(t)},this));if(i.notifyParams.click){i.popupContainer.style.cursor="pointer";BX.bind(i.popupContainer,"click",BX.delegate(function(t){this.notifyParams.click(this);return BX.PreventDefault(t)},i))}this.stackPopup[i.uniquePopupId]=i}if(this.stack.length>0){this.clearAutoHide(true);this.setAutoHide(this.notifyHideTime)}this.garbage()};t.prototype.closeByTag=function(t){for(var e=0;e<this.stack.length;e++){if(typeof this.stack[e]!="undefined"&&this.stack[e].tag==t){delete this.stack[e]}}for(e in this.stackPopup){if(this.stackPopup.hasOwnProperty(e))if(this.stackPopup[e].notifyParams.tag==t)this.stackPopup[e].close()}};t.prototype.setShowTimer=function(t){clearTimeout(this.stackTimeout);this.stackTimeout=setTimeout(BX.delegate(this.show,this),t)};t.prototype.setAutoHide=function(t){this.notifyAutoHide=true;clearTimeout(this.notifyAutoHideTimeout);this.notifyAutoHideTimeout=setTimeout(BX.delegate(function(){for(var e in this.stackPopupTimeout){if(this.stackPopupTimeout.hasOwnProperty(e)){this.stackPopupTimeout[e]=setTimeout(BX.delegate(function(){this.close()},this.stackPopup[e]),t-1e3);this.stackPopupTimeout2[e]=setTimeout(BX.delegate(function(){this.setShowTimer(300)},this),t-700)}}},this),1e3)};t.prototype.clearAutoHide=function(t){clearTimeout(this.notifyGarbageTimeout);this.notifyAutoHide=false;t=t===true;var e;if(t){clearTimeout(this.stackTimeout);for(e in this.stackPopupTimeout){if(this.stackPopupTimeout.hasOwnProperty(e)){clearTimeout(this.stackPopupTimeout[e]);clearTimeout(this.stackPopupTimeout2[e])}}}else{clearTimeout(this.notifyAutoHideTimeout);this.notifyAutoHideTimeout=setTimeout(BX.delegate(function(){clearTimeout(this.stackTimeout);for(var t in this.stackPopupTimeout){if(this.stackPopupTimeout.hasOwnProperty(t)){clearTimeout(this.stackPopupTimeout[t]);clearTimeout(this.stackPopupTimeout2[t])}}},this),300)}};t.prototype.garbage=function(){clearTimeout(this.notifyGarbageTimeout);this.notifyGarbageTimeout=setTimeout(BX.delegate(function(){var t=[];for(var e=0;e<this.stack.length;e++){if(typeof this.stack[e]!="undefined")t.push(this.stack[e])}this.stack=t},this),1e4)};t.prototype.check=function(t,e,i,o){if(t[1]<=0||!window["UC"]["Informer"]||!BX.type.isNotEmptyString(o))return;var s=/(\d+)/g.exec(t[0]),n=BX("record-"+t.join("-")+"-cover");s=!!s?parseInt(s):0;if(s<=0||!n)return false;else if(BX.util.in_array(s,window["UC"]["InformerTags"][i]))return true;window["UC"]["InformerTags"][i].push(s);var a=!!e&&!!e["messageFields"]?e["messageFields"]:false;if(!a)return;var r=BX.pos(n),p=BX.GetWindowScrollPos(),u=BX.GetWindowInnerSize();if(r.top<p.scrollTop||r.top>p.scrollTop+u.innerHeight-20){setTimeout(function(){if(parseInt(a["AUTHOR"]["ID"])!=parseInt(BX.message("USER_ID"))){var e=BX.create("div",{props:{className:"bx-spbc-notifier-item"},children:[BX.create("span",{props:{className:"bx-spbc-notifier-item-content"},children:[BX.create("span",{props:{className:"bx-spbc-notifier-item-avatar"},children:[!!a["AUTHOR"]["AVATAR"]?BX.create("img",{props:{className:"bx-spbc-notifier-item-avatar-img"},attrs:{src:a["AUTHOR"]["AVATAR"]}}):""]}),BX.create("a",{attrs:{href:"#"},props:{className:"bx-spbc-notifier-item-delete"}}),BX.create("span",{props:{className:"bx-spbc-notifier-item-name"},html:a["AUTHOR"]["NAME"]}),BX.create("span",{props:{className:"bx-spbc-notifier-item-time"},html:a["POST_TIME"]}),BX.create("span",{props:{className:"bx-spbc-notifier-item-text"}}),BX.create("span",{props:{className:"bx-spbc-notifier-item-text2"},html:'"'+o+'"'})]})]}),i=BX.GetWindowScrollPos();window["UC"]["Informer"].add({html:e,tag:"im-record-"+t.join("-"),click:BX.delegate(function(){var e=BX.pos(BX("record-"+t.join("-")));new BX.easing({duration:500,start:{scroll:i.scrollTop},finish:{scroll:e.top-100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){window.scrollTo(0,t.scroll)}}).animate()},this)})}},50)}};t.NativeNotify=function(){return window.webkitNotifications&&window.webkitNotifications.checkPermission()==0};window["UC"]["Informer"]=new t;window["UC"]["InformerTags"]={};t.notifyManagerShow=function(){BX.ready(function(){BX.addCustomEvent("onNotifyManagerShow",function(t){if(t.originalTag){var e=t.originalTag.lastIndexOf("|"),i=t.originalTag.substr(0,e);if(!!window["UC"]["InformerTags"][i]){var o=parseInt(t.originalTag.substr(e+1));window["UC"]["InformerTags"][i].push(o)}}})})}})();
//# sourceMappingURL=scripts_for_im.map.js